package com.my.behaviourtype.memento;

public class Test {

	public static void main(String[] args) {
		Originator originator = new Originator();
		originator.setState("eating...");
		
		Caretaker taker = new Caretaker();
		taker.setMemento(originator.createMemento());// snap state to a memento and save it
		
		originator.setState("drinking...");
		originator.execute();
		
		originator.useMemento(taker.getMemento());
		originator.execute();
	}

}
